<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: id
  Date: 2021/1/15
  Time: 9:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page  isELIgnored="false" contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../util/makerAndenterGoodAndselect1.jsp"%>
<html>
<head>
    <title>Show Maker2</title>
    <style type="text/css">
        #center{
            width: 1288px;
            height:60px;
            position: absolute;
            top: 60px;
            left: 83px;
        }
        /*from表单*/
        .ctop{
            position: relative;
            left: 44px;
            top: 10px;
            border-radius: 10px;
            width: 1200px;
            height: 40px;
            box-sizing: border-box;
            padding-top: 5px;
            padding-left: 15px;
            border: 1px solid paleturquoise;
        }

        #tab{
            box-sizing: border-box;
            padding-left: 96px;
            width: 1288px;
            height: 300px;
            position: absolute;
            top: 115px;
            left: 87px;
        }
        #pos{
            position: absolute;
            left: 300px;
            top:10px;
        }


    </style>
    <script type="text/javascript" src="../../../static/jquery-3.4.1.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#tab").hover(function () {
                $("#d4").hide()
                $("#xs").hide()
                $("#d3").hide()
                $("#d4").hide()
            })
        })

        /*删除*/
        function del(m2id) {
            var url="${pageContext.request.contextPath}/Maker2Controller/del?m2id="+m2id;
            if(confirm("您确认删除吗?")){
                location.href=url;
                return true;
            }else {
                return  false;
            }
        }

        /*修改*/
        function preUpd(m2id) {
            var url="${pageContext.request.contextPath}/Maker2Controller/UPD?m2id="+m2id;
            if(confirm("您确认修改吗?")){
                location.href=url;
                return true;
            }else {
                return  false;
            }
        }

    </script>
</head>
<body>
<!--************************************************************************************************************************-->
<!--查询的文本框上半部分-->
<div id="center">
    <div id="pos">
<c:if test="${sessionScope.boosUser!=null}">
        <button id="btn" style="width: 100px;height: 2em;border-radius: 7px;margin-left: 740px">
            <a href="${pageContext.request.contextPath}/Maker2Controller/priAddMaker2?rid=${rid}&m1id=${mid}&goodstyle=${goodstyle}">
                新增销售单
            </a>
        </button>
</c:if>
    </div>
</div>

<%--展示--%>
<div id="tab">
    <table style="width: 1100px;height: 180px;text-align: center" border="1" >
        <tr>
            <td>商品名称</td>
            <td>商品编号</td>
            <td>数量</td>
            <td>单位</td>
            <td>单价</td>
            <td>折扣</td>
            <td>折扣后单价</td>
            <td>折扣前金额(总金额)</td>
            <td>折扣后金额(实际的金额)</td>
            <td>操作</td>
        </tr>
        <c:forEach var="list" items="${list}">
            <tr>
                <td>${list.goods2}</td>
                <td>${list.docuemnt2}</td>
                <td>${list.num}</td>
                <td>${list.danwei}</td>
                <td>${list.onemoney}</td>
                <td>${list.discount}</td>
                <td>${list.nowmoney}</td>
                <td>${list.countmoney}</td>
                <td>${list.discountmoney}</td>
                <td>
                    <c:if test="${sessionScope.boosUser!=null}">
                    <a href="javascript:del(${list.m2id})">
                        <img src="../../../static/img/delete.png" alt="删除订单" >
                    </a>

                    <a href="javascript:preUpd(${list.m2id})">
                        <img src="../../../static/img/update.png" alt="修改订单" >
                    </a>
                    </c:if>

                    <c:if test="${sessionScope.boosUser==null}">
                            <span style="color: gray">无权限</span>
                    </c:if>

                </td>
            </tr>
        </c:forEach>


    </table>



</div>

</body>
</html>
